﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%= TempData["Message"]%>
    <%=Html.Hidden("PartnerID", ViewData["PartnerID"])%>
    <div id="cactionbutton">
        <button type="button" id="btnRefesh" title="Refesh" class="button refresh">
            Làm mới</button>
        <button type="button" id="btnDelete" title="Delete" class="button delete">
            Xóa</button>
        <button type="button" id="btnAddnew" title="Refesh" class="button addnew">
            Tạo mới</button>
        <button type="button" id="btnBack" title="Back" class="button back">
            Quay về</button>
    </div>
    <div class="clist">
        <table id="list" class="scroll">
        </table>
        <div id="pager" class="scroll" style="text-align: center;">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageTitle" runat="server">
    Thẻ sinh viên - Đối tác
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="/Scripts/highslide/highslide.js"></script>
    <link rel="stylesheet" type="text/css" href="/Scripts/highslide/highslide.css" />
    <script src="/Scripts/jquery.validate.js" type="text/javascript"></script>
    <script type="text/javascript">
        hs.graphicsDir = '/Scripts/highslide/graphics/';
        hs.outlineType = 'rounded-white';
        $(document).ready(function () {
            $("#txtKeyword").autocomplete('/Library/GenericHandle/AutoCompleteHandler.ashx/?Page=Partner');
            jQuery("#list").jqGrid({
                url: '/Partner/GetListGalleryJQGrid/?id=' + $("#PartnerID").val(),
                datatype: 'json',
                mtype: 'GET',
                colNames: ['ID', 'Order', 'Hình', 'Kích Hoạt', 'Vị trí'],
                colModel: [
                  { name: 'ID', index: 'ID', align: "center", width: 50, hidden: true },
                  { name: 'Order', index: 'Order', align: "center", width: 50, hidden: true },
                  { name: 'Image', index: 'Image', align: "center", width: 200, sortable: false },
                  { name: 'Active', index: 'Active', align: "center", width: 100, sortable: false },
                  { name: 'Position', index: 'Position', align: "center", width: 100, sortable: false}],
                pager: jQuery('#pager'),
                rowList: [20, 30, 50, 100, 200],
                sortname: 'Order',
                sortorder: "asc",
                multiselect: true,
                viewrecords: true,
                width: 800, height: "100%",
                imgpath: '/scripts/grid/themes/basic/images',
                loadui: 'block'
            });
            JS_LIB.onEnterKeyword();
            $("#btnRefesh").click(function () {
                window.location = "/Administration/Partner/Gallery/" + $("#PartnerID").val();
            });
            $("#btnBack").click(function () {
                JS_LIB.redirect("/Administration/Partner");
            });
            $("#btnAddnew").click(function () {
                JS_LIB.popup('/Administration/Partner/CreateGallery/' + $("#PartnerID").val(), "Thêm hình", 470);
            });
            $("#btnDelete").click(function () {
                var checked = jQuery("#list").find("tr > td > input[type=checkbox]:checked").length;
                if (checked == 0) {
                    JS_LIB.msgBox("Hãy chọn dòng để xóa!", 350);
                }
                else {
                    var arrID = getJqgridSelectedIDs('#list', 'ID');
                    JS_LIB.msgConfirmBox('Bạn có chắc là bạn muốn xóa?', 350, 'removeGallery(\'' + arrID + '\')');
                }
            });
        });
        function removeGallery(arrID) {
            window.location = "/Administration/Partner/DeleteGalleryList/?ids=" + arrID + "&partnerId=" + $('#PartnerID').val();
        }
    </script>
    <style type="text/css">
        .ui-jqgrid tr.jqgrow td
        {
            white-space: normal;
        }
    </style>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ModuleName" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="FunctionTitle" runat="server">
    <a href="/Administration/Partner">Đối tác</a> » <%= ViewData["PartnerName"]%> » Thư viện ảnh
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="LoginRoles" runat="server">
</asp:Content>
